//
//  QLStatusCell.swift
//  MQLWeibo
//
//  Created by MQL-IT on 2017/3/23.
//  Copyright © 2017年 MQL-IT. All rights reserved.
//

import UIKit

class QLStatusCell: UITableViewCell {
    /// 微博视图模型
    var viewModel: StatusViewModel? {
        didSet {
            //微博文本
            statusLabel.text = viewModel?.status.text
            //姓名
            nameLabel.text = viewModel?.status.user?.screen_name
            //会员图标,直接获取属性, 计算的功能交给StatusViewModel处理
            memberIconView.image = viewModel?.memberIcon
            //认证图标
            vipIconView.image = viewModel?.vipIcon
            //用户头像
            iconView.ql_setImage(urlString: viewModel?.status.user?.profile_image_url, placeHolderImage: UIImage(named: "avatar_default_big"), isAvatar: true)
        }
    }

    /// 头像
    @IBOutlet weak var iconView: UIImageView!
    /// 姓名
    @IBOutlet weak var nameLabel: UILabel!
    /// 会员
    @IBOutlet weak var memberIconView: UIImageView!
    /// 时间
    @IBOutlet weak var timeLabel: UILabel!
    /// 来源
    @IBOutlet weak var sourceLabel: UILabel!
    /// 认证图标
    @IBOutlet weak var vipIconView: UIImageView!
    /// 微博正文
    @IBOutlet weak var statusLabel: UILabel!
    
    
    
    override func awakeFromNib() {
        super.awakeFromNib()

    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
